import java.awt.Component;

import javax.sound.midi.Instrument;
import javax.swing.DefaultListCellRenderer;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.ListCellRenderer;


public class InstrumentCellRenderer implements ListCellRenderer<Instrument> {

	protected DefaultListCellRenderer defaultRenderer = new DefaultListCellRenderer();
	
	@Override
	public Component getListCellRendererComponent(
			JList<? extends Instrument> list,
			Instrument value,
			int index,
			boolean isSelected,
			boolean cellHasFocus
	) {
		JLabel label = (JLabel) defaultRenderer.getListCellRendererComponent(
				list,
				value,
				index,
		        isSelected,
		        cellHasFocus);
		label.setText(label.getText().split(":")[1].split("bank")[0].trim());
		return label;
	}

}
